package EA;

public class Interval
{
  public double min, max;
  
  public Interval(double MIN,double MAX)
    {
      min = MIN;
      max = MAX;
    }

  /** Get the length of an the interval. */
  public double getLength()
    {
      return max-min;
    }
  
  /** Set min and max.
   */
  public void setMinMax(double MIN,double MAX)
    {
      min = MIN;
      max = MAX;
    }

  /** Bring a value into the range of this interval. */
  public double bringInClosedRange(double value)
    {
      return Math.max(min, Math.min(max, value));
    }

}
